﻿//===================================================加载内容显示加载方式================================================
$(function () {
    //页面加载内容时追加html到后面
    var html = "";
    html += "<div style=\"position: fixed; width: 100%; top: 1%; height: 100%; background-color: #B2B2B2; opacity: 0.5; filter: alpha(opacity=50); display: none\" id=\"saveLoadDiv\">";
    html += " <div style=\"text-align: center; margin-top: 300px;\">"
    html += "<strong style='padding-top:8px;color:#000000;margin-left: -100px;position: absolute;' id='saveLoadDivTip'> 请稍等</strong><img src=\"/qh/static/images/loading.gif\" /> </div> </div>";
    $(document.body).append(html);

    //页面加载内容时追加部分DIV内容
    var Phtml = "";
    Phtml += "<div style=\"position: relative; width: 100%; height: 100%; background-color: #B2B2B2; opacity: 0.5; filter: alpha(opacity=50);\" class=\"saveLoadPortionDiv\">";
    Phtml += " <div style=\"text-align: center; margin: 30% 0% 0% 50%;position: absolute;\">"
    Phtml += "<strong style='padding-top:8px;color:#000000;margin-right:40px;' id='saveLoadPortionTip'> 请稍等</strong><img src=\"/qh/static/images/loading.gif\" /></div></div>";
    $(".showLoaddiv").append(Phtml);
}); 

var myLoading = {
    showLoading: function (obj,Tip) {
        // var clearSet;
        //关闭
        if (!obj) {
            $("#saveLoadDiv").hide();
        }
        else {
            $("#saveLoadDiv").show();
            //如果出现js错误，20s后关闭    
            clearSet = setTimeout("myLoading.showLoading(false)", 20000);
        }
        $("#saveLoadDivTip").html(Tip);
    },
    showPortionLoading: function (obj,Tip) {
        // var clearSet;
        //关闭
        if (!obj) {
            $(".saveLoadPortionDiv").hide();
        }
        else {
            $(".saveLoadPortionDiv").show();
            //如果出现js错误，20s后关闭    
            clearSet = setTimeout("myLoading.showPortionLoading(false)", 20000);
        }
        $("#saveLoadPortionTip").html(Tip);
    }
}
////如果保存成功直接隐藏不用再执行关闭方法;
//if (errorInfo == 'true' || errorInfo) {
//    clearInterval(clearSet);
//    return;
//}





















































